/*
 * @Description: 
 * @Author: mmzhang
 * @Date: 2022-01-20 17:22:17
 * @LastEditTime: 2022-02-18 11:58:59
 */
import biApi from '@/config/server/api/bi'

// 线索

function getListClueChannel(params) {
  return biApi.clue.listClueChannel.fetch(params).then(res => {
    res.forEach(ele => {
      ele.key = ele.clueChannelId
      ele.value = ele.clueChannelName
    });
    return res
  })
}

function getList(params) {
  return biApi.clue.list.fetch(params).then(res => {
    return res
  })
}

function getListCount(params) {
  return biApi.clue.count.fetch(params).then(res => {
    return res
  })
}

function exportClueReport(params) {
  return biApi.clue.export.fetch(params)
}

function getListPushResult(params) {
  return biApi.clue.listPushResult.fetch(params).then(res => {
    res.forEach(ele => {
      ele.key = ele.pushResultCode
      ele.value = ele.pushResultMsg
    });
    return res
  })
}

export default {
  getListClueChannel,
  getList,
  getListCount,
  exportClueReport,
  getListPushResult
}